package main

import (
	"fmt"
	"net/http"

	"htmlcopy/controller"

	"golang.org/x/net/websocket"
)

func main() {
	fmt.Println("web server start...")

	http.HandleFunc("/", controller.Main)

	http.HandleFunc("/searchajax", controller.SearchAjax)
	http.Handle("/searchsocket", websocket.Handler(controller.SearchSocket))
	http.HandleFunc("/persistentid", controller.PersistentId)

	http.HandleFunc("/like", controller.Like)
	http.HandleFunc("/setlike", controller.SetLike)
	http.HandleFunc("/js", controller.Js)
	http.HandleFunc("/css", controller.Css)

	err := http.ListenAndServe(":80", nil)
	if err != nil {
		panic(err)
	}
}
